package com.thd.springboot.framework.example;

import com.spring4all.swagger.EnableSwagger2Doc;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;

import java.util.stream.Stream;

@SpringBootApplication(scanBasePackages = {"com.thd.*"})
//@ComponentScan({"com.thd.*"})
//@MapperScan("com.thd.springboot.framework.example.mapper")

@EnableFeignClients
public class ExampleApplicationServer {

    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        return builder.sources(this.getClass());
    }


    public static void main(String[] args) {
        //System.setProperty("spring.devtools.restart.enabled", "false");
        ConfigurableApplicationContext ctx = SpringApplication.run(ExampleApplicationServer.class, args);
        String[] names = ctx.getBeanDefinitionNames();
        Stream.of(names).forEach(System.out::println);
    }

}
